package com.tristia.entity;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "books"
})
@XmlRootElement
public class Books {

    @XmlElement(name="book", required = true)
    protected List<Book> books;
    
    public Books() {
    }

    public Books(List<Book> books) {
    	setBooks(books);
	}

    public List<Book> getBooks() {
        if (books == null) {
        	books = new ArrayList<Book>();
        }
        return this.books;
    }
    
	public void setBooks(List<Book> books) {
		this.books = books;
	}

	@Override
	public String toString() {
		return (this.books != null) ? "{\"books\": " + this.books.toString() + "}" : "{books:[]}";
	}
}
